<!DOCTYPE html>
<html>
<head>
	<title>餐饮营销支持系统</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="../../css/bootstrap.min.css" rel="stylesheet">
	<!-- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> -->
	<link rel="stylesheet" type="text/css" href="../../css/waiter.css">
	<link rel="stylesheet" type="text/css" href="../../css/manager.css">
</head>
<body>
	<div id="head">
		<div class="navbar navbar-default  navbar-inverse" role="navigation">
			<div class="navbar-header">
				<a href="##" class="navbar-brand">餐饮营销支持系统</a>
			</div>
			<!-- 	<a href="javascript:if(confirm('确定要推出登录吗?'))location='sign.html'"> -->
			<button type="submit" class="btn btn-danger">
				<span style="margin-right: 5px" class="glyphicon glyphicon-off"></span>注销
			</button>
			<!-- </a> -->
		</div>
	</div>
	<div id="left">

		<p class="left-head">
			经理登录</p>
			<div class="container">
				<div class="row" style="margin-top: 0px">
					<a href="./manager.html">
						<div class="col-md-12">
							<span class="glyphicon glyphicon-user"></span>
							<p>个人信息</p>
						</div>
					</a>
				</div>
				<div class="row act">
					<div class="col-md-12">
						<span class="glyphicon glyphicon-th"></span>
						<p>收入查询</p>
					</div>
				</div>
				<div class="row">
					<a href="./manager-three.html">
						<div class="col-md-12">
							<span class="glyphicon glyphicon-asterisk"></span>
							<p>服务员管理</p>
						</div>
					</a>
				</div>
				<div class="row">
					<div class="col-md-12"></div>
				</div>
			</div>
		</div>
		<div id="right">
			<div class="right-head">
				<ol class="breadcrumb">
					<li><a href="#">首页</a></li>
					<li class="active">每日收入详情</li>
				</ol> 
			</div>
			<div class="con">
				<div class="container">
					<div class="row">
						<div class="col-md-12">
							<div class="panel panel-default">
								<div class="panel-body">
									<div class="row pan-head">
										<p>
											每日收入详情
										</p>
										<div class="pan-headB">
											<button type="submit" class="btn btn-info" id="">
												<span style="margin-right: 5px" class="glyphicon glyphicon-signal"></span>统计
											</button>
										</div>
									</div>
									<div class="row" style="margin-top: 0">
										<label class="col-lg-3 control-label">
											选择时间：
										</label>
										<div class="col-lg-9" style="position: relative;">
											
											<input style="width: 63%;float: left;" type="date" id="mydate" class="bg-focus form-control">
											<button style="float: left;margin-left: 10px;margin-top: 2px" id="seeMyIncome" type="button" class="btn btn-primary btn-sm">
												<span style="margin-right: 5px" class="glyphicon glyphicon-search"></span>查询
											</button>
										</div>
									</div>
									<div class="row">
										<div class="col-lg-10 col-lg-offset-1">
											<div class="table-responsive">
												<table class="table table-striped table-bordered table-hover">
													<thead>
														<tr>
															<th>店铺</th>
															<th>座位号</th>
															<th>消费时间</th>
															<th>是否有推荐人</th>
															<th>推荐金</th>
															<th>消费金额</th>
														</tr>
													</thead>
													<tbody id ="incomes">
													</tbody>
												</table>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script src="../../js/Jquary/jquery-3.2.1.min.js"></script>
		<script src="../../js/Jquary/jquery.easyui.min.js"></script>
		<script src="../../js/bootstrap.min.js"></script>
		<script type="text/javascript" src="../../js/logout.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$("#seeMyIncome").click(function(){
					var date = $("#mydate").val();
					if(date==null||date==""){
						alert("请先选择日期");
						return;
					}; 
					getMyIncome(date);
				})
			})
		</script>
		<script type="text/javascript">
			function getMyIncome(date){
				$.ajax({
					type:"get",
					url:"/ldss/store/myincome",
					data:{
						transdate:date
					},
					async:false,
					dataType:"json",
					success: function (data) {
						if(data.success){
							var data = data.data;
							var dateIncome = data.incometranss;
							$("#incomes").empty();
							for(var i = 0; i < dateIncome.length; i++){
								$("#incomes").append(
									"<tr>"+
										"<td>"+dateIncome[i].store+"</td>"+
										"<td>"+dateIncome[i].position+"</td>"+
										"<td>"+dateIncome[i].transactionTime+"</td>"+
										"<td>"+dateIncome[i].ishavereferee+"</td>"+
										"<td>"+dateIncome[i].refereeamount+"</td>"+
										"<td>"+dateIncome[i].transactionAmount+"</td>"+
									"</tr>"
								);
				            }
				            $("#incomes").append(
								"<tr>"+
									"<th colspan='4'>总计：</th>"+
									"<td>"+data.referee+"</td>"+
									"<td>"+data.store+"</td>"+
								"</tr>"
							);
						}
						else{
							alert(data.message);
						}
					}
				})
			}
		</script>
	</body>
	</html>